package cn.dnf.fallbackFactory;

import cn.dnf.domain.Ticket;
import cn.dnf.domain.User;
import cn.dnf.feign.UserFeignClients;
import cn.dnf.util.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallbackFactory implements FallbackFactory<UserFeignClients> {
    @Override
    public UserFeignClients create(Throwable throwable) {
        return new UserFeignClients() {
            @Override
            public JsonResult add(Ticket ticket) {
                return JsonResult.me().setMessage("观众挂了");
            }
        };
    }
}
